import { getAllShop } from '@/api/getData'
const state = {
  maps: [],
  query: {
    total: 0,
    size: 10,
    page: 1
  }
}
const mutations = {
  SET_MAPS (state, data) {
    state.maps = [].concat(data)
  }
}
const actions = {
  _get_all_shop_maps ({ commit }, params) {
    return new Promise((resolve, reject) => {
      getAllShop(params).then(res => {
        // eslint-disable-next-line no-unused-vars
        const { error, payload, message } = res
        if (error === 200) {
          commit('SET_MAPS', payload)
          resolve()
        }
      })
    })
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}
